#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXLEN 1024

char hold[MAXLEN] = "";
char* keywords[] = {
    "if",
    "else",
    "while",
    "break",
    "continue",
    "return",
};
char* keywordsToken[] = {
    "If",
    "Else",
    "While",
    "Break",
    "Continue",
    "Return",
};

char* FindKeywords(char str[]) {
    int i;
    // printf("====%d====\n", sizeof(keywords) / sizeof(keywords[0]));
    for (i=0; i<sizeof(keywords)/sizeof(keywords[0]); i++) {
        if (strcmp(keywords[i], str) == 0) {
            // printf("====%s====\n", keywordsToken[i]);
            return keywordsToken[i];
        }
    }
    return "";
}

int isBlank(char c) {
    return c == ' ' || c == '\t' || c == '\n'; 
}

int isDigit(char c) {
    return c >= '0' && c <= '9'; 
}

int isLetter(char c) {
    return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'; 
}

int isUnderLine(char c) {
    return c == '_'; 
}

int main() {
    char ch;
    memset(hold,'\0',sizeof(hold));
    while(1) {
        // 跳过空白字符
        while (isBlank(ch = getchar()));

        // 文件结束判断
        if (ch == EOF) {
            break;
        }
        
        // 无符号整数判断
        if (isDigit(ch)) {
            hold[0] = ch;
            for (int i=1; isDigit(ch = getchar()); i++) {
                hold[i] = ch;
            }
            printf("Number(%s)\n", hold);
            memset(hold,'\0',sizeof(hold));     // 重置hold
            ungetc(ch, stdin);
        }

        // 标识符(关键字)判断
        else if (isLetter(ch) || isUnderLine(ch)) {
            hold[0] = ch;
            for (int i=1; isDigit(ch = getchar()) || isLetter(ch) || isUnderLine(ch); i++) {
                hold[i] = ch;
            }
            char token[128];
            // 关键字判断
            strcpy(token, FindKeywords(hold));
            if ((strcmp(token, "")) != 0) {
                printf("%s\n", token);
            }
            else {
                printf("Ident(%s)\n", hold);
            }
            memset(hold,'\0',sizeof(hold));     // 重置hold
            ungetc(ch, stdin);
        }

        // 特殊符号判断
        else if (ch == '=') {
            ch = getchar();
            if (ch == '=') {
                printf("Eq\n");
            } else {
                printf("Assign\n");
                ungetc(ch, stdin);
            }
        }
        else if (ch == ';') {
            printf("Semicolon\n");
        }
        else if (ch == '(') {
            printf("LPar\n");
        }
        else if (ch == ')') {
            printf("RPar\n");
        }
        else if (ch == '{') {
            printf("LBrace\n");
        }
        else if (ch == '}') {
            printf("RBrace\n");
        }
        else if (ch == '+') {
            printf("Plus\n");
        }
        else if (ch == '*') {
            printf("Mult\n");
        }
        else if (ch == '/') {
            printf("Div\n");
        }
        else if (ch == '<') {
            printf("Lt\n");
        }
        else if (ch == '>') {
            printf("Gt\n");
        }

        // 错误符号判断
        else {
            printf("Err\n");
            break;
        }
    }
    
    return 0; 
}